package com.designpatterns.observer;

import com.designpatterns.observer.classto.ObjectFor3D;
import com.designpatterns.observer.classto.ObserverUser1;
import com.designpatterns.observer.classto.ObserverUser2;

public class test {
    public static void main(String[] args) {
        //创建服务号
        ObjectFor3D objectFor3D = new ObjectFor3D();

        //创建2个订阅者,注册到我们的集合中
        ObserverUser1 observerUser1 = new ObserverUser1(objectFor3D);
        ObserverUser2 observerUser2 = new ObserverUser2(objectFor3D);

        //两个观察者，发送两条信息
        objectFor3D.setMsg("201610121 的3D号为:127");

    }
}
